Skip to content

Reduce false-positive “New Music Update” issues in music-social workflow#271

Merged
DavidKRK merged 3 commits into
gh-pagesfrom
copilot/music-update-03-06-2026
Jun 3, 2026
Merged

Reduce false-positive “New Music Update” issues in music-social workflow#271
DavidKRK merged 3 commits into
gh-pagesfrom
copilot/music-update-03-06-2026

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 3, 2026

The music-social automation was opening “New Music Update” issues for non-musical edits to music.html (e.g., Lighthouse-related changes).
This PR narrows detection to real music-content additions so social-post issues are created only when new platform links are actually added.

  • Scope detection to real music content

    • Compute diff refs once (BASE_REF / TARGET_REF) and keep existing global line stats.
    • Extract and compare only the YOUTUBE-AUTO block instead of scanning all added lines.
    • Trigger has_music_content=true only when added lines in that block contain supported music links (youtube, youtu.be, soundcloud, bandcamp).
  • Harden edge-case handling

    • Add explicit empty-tree handling for first-commit/manual fallback paths.
    • Avoid invalid git show behavior when no prior tree contains music.html.
NEW_MUSIC_BLOCK=$(git show "$TARGET_REF:music.html" | sed -n '/<!-- YOUTUBE-AUTO-START -->/,/<!-- YOUTUBE-AUTO-END -->/p')

if [ "$BASE_REF" = "$EMPTY_TREE" ]; then
  OLD_MUSIC_BLOCK=""
else
  OLD_MUSIC_BLOCK=$(git show "$BASE_REF:music.html" | sed -n '/<!-- YOUTUBE-AUTO-START -->/,/<!-- YOUTUBE-AUTO-END -->/p')
fi

MUSIC_BLOCK_DIFF=$(diff -u <(echo "$OLD_MUSIC_BLOCK") <(echo "$NEW_MUSIC_BLOCK") || true)
MUSIC_BLOCK_ADDED=$(echo "$MUSIC_BLOCK_DIFF" | grep "^+" | grep -v "^+++" | sed 's/^+//' | head -50)

if echo "$MUSIC_BLOCK_ADDED" | grep -qiE "$MUSIC_LINK_PATTERN"; then
  echo "has_music_content=true" >> "$GITHUB_OUTPUT"
fi

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copilot AI linked an issue Jun 3, 2026 that may be closed by this pull request
6 tasks
Copilot AI changed the title [WIP] Fix Lighthouse scores below acceptable threshold Reduce false-positive “New Music Update” issues in music-social workflow Jun 3, 2026
Copilot AI requested a review from DavidKRK June 3, 2026 17:05
@DavidKRK DavidKRK marked this pull request as ready for review June 3, 2026 21:59
Copilot AI review requested due to automatic review settings June 3, 2026 21:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the music-social GitHub Actions workflow to reduce false “New Music Update” issue creation by narrowing the detection logic to changes within the YOUTUBE-AUTO section of music.html, rather than scanning all added lines across the file.

Changes:

  • Compute and reuse BASE_REF / TARGET_REF once, then derive DIFF, line stats, and detection from those refs.
  • Extract and compare only the <!-- YOUTUBE-AUTO-START --><!-- YOUTUBE-AUTO-END --> block to decide whether to set has_music_content=true.
  • Update the music-content detection to rely on added content from that extracted block using a supported-link regex.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +56 to +65
MUSIC_LINK_PATTERN='https?://(www\.)?(youtube\.com|youtu\.be|soundcloud\.com|bandcamp\.com)'
NEW_MUSIC_BLOCK=$(git show "$TARGET_REF:music.html" | sed -n '/<!-- YOUTUBE-AUTO-START -->/,/<!-- YOUTUBE-AUTO-END -->/p')
if [ "$BASE_REF" = "$EMPTY_TREE" ]; then
OLD_MUSIC_BLOCK=""
else
OLD_MUSIC_BLOCK=$(git show "$BASE_REF:music.html" | sed -n '/<!-- YOUTUBE-AUTO-START -->/,/<!-- YOUTUBE-AUTO-END -->/p')
fi
MUSIC_BLOCK_DIFF=$(diff -u <(echo "$OLD_MUSIC_BLOCK") <(echo "$NEW_MUSIC_BLOCK") || true)
MUSIC_BLOCK_ADDED=$(echo "$MUSIC_BLOCK_DIFF" | grep "^+" | grep -v "^+++" | sed 's/^+//' | head -50)

Copy link
Copy Markdown
Owner

@DavidKRK DavidKRK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beau clean-up de la détection.
Le passage à BASE_REF / TARGET_REF rend le diff plus lisible, et le fait de cibler le bloc YOUTUBE-AUTO évite les faux positifs liés aux simples lignes ajoutées.
LGTM, j’approuve.

@DavidKRK DavidKRK merged commit 7f40fe4 into gh-pages Jun 3, 2026
15 checks passed
@DavidKRK DavidKRK deleted the copilot/music-update-03-06-2026 branch June 3, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🎵 New Music Update — 03/06/2026 04:39:22

3 participants